Skip to content

Renderers and multi channels - #1

Merged
csvwolf merged 26 commits into
mainfrom
renderers
Jul 27, 2026
Merged

csvwolf merged 26 commits into
mainfrom
renderers

Conversation

@tiye

@tiye tiye commented May 26, 2026

Copy link
Copy Markdown
Member

No description provided.

@tiye
tiye requested review from a team and Copilot May 26, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends edn-renderer to support richer renderer/relay workflows (multi-channel selection + renderer-provided help/skill/status) and adds ECharts-based chart rendering, alongside updated operational documentation and an RFC capturing Mermaid stability learnings.

Changes:

  • Add ECharts dependency and implement chart rendering via a Respo effect, plus global resize handling.
  • Introduce multi-channel UI/relay handshake changes and renderer ops (help/skill/status) served via protocol ack.
  • Add/expand documentation (Skill guide, components reference, Mermaid stability RFC) and update dev workflow notes.

Reviewed changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
yarn.lock Locks new echarts (and transitive) dependencies.
package.json Adds echarts dependency.
.pnp.cjs Updates Yarn PnP dependency map for echarts.
main.mjs Replaces Mermaid bootstrap with ECharts resize handling + app entry.
deps.cirru Adds Respo/alerts.calcit dependency.
calcit.cirru Implements multi-channel selection, renderer ops responses, Mermaid/ECharts effects, and updated UI.
COMPONENTS.md Expands component DSL documentation (includes chart/mermaid sections).
SKILL.md New reusable workflow/skill manual for edn-relay + edn-renderer.
RFCs/2026-05-mermaid-rendering-stability.md New accepted RFC documenting Mermaid rendering stability diagnosis/decisions.
Agents.md Updates dev workflow notes and adds Mermaid/Calcit pitfalls guidance.
.gitignore Ignores artifacts/*.
Files not reviewed (1)
  • .pnp.cjs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread calcit.cirru
Comment on lines +592 to +616
if (nil? output) (.!warn js/console "|[mermaid] missing .mermaid-output" el)
if
some? $ get @*rendered-svgs source
.!debug js/console "|[mermaid] skip rendered"
do
reset! *rendered-svgs $ assoc @*rendered-svgs source :rendering
ensure-mermaid!
let
render-fn $ .-render mermaid-lib
try
let
result $ js-await (.!call render-fn mermaid-lib graph-id source)
svg $ .-svg result
bind-fns $ .-bindFunctions result
do
set! (.-innerHTML output) svg
when (some? bind-fns) (bind-fns output)
reset! *rendered-svgs $ assoc @*rendered-svgs source svg
.!debug js/console "|[mermaid] render" $ js-object
:length $ count source
:graphId graph-id
fn (error)
do
reset! *rendered-svgs $ assoc @*rendered-svgs source false
.!error js/console "|[mermaid] render failed" error
Comment thread calcit.cirru
Comment on lines +68 to +76
defn build-mermaid-render-payload (text)
let
source $ if (string? text) text |
trimmed $ trim source
if (= trimmed |)
{} (:empty? true) (:source |) (:graph-id |)
{} (:empty? false) (:source source)
:graph-id $ str |mermaid- (count source) |-
count $ split-lines source
Comment thread calcit.cirru
Comment on lines +455 to +466
do (.!debug js/console "|[echarts] render/raw" option) (.!log js/console "|[echarts] render/plain" plain-option)
.!log js/console "|[echarts] render/plain-json" $ js/JSON.stringify plain-option nil 2
.!log js/console "|[echarts] host-size" (.-clientWidth el) (.-clientHeight el)
.!setOption chart plain-option true
dispose-chart $ fn ()
let
chart $ echarts-lib/getInstanceByDom el
when (some? chart) (.!dispose chart)
case-default action nil
:mount $ do (.!debug js/console "|[echarts] mount") (render-chart)
:update $ do (.!debug js/console "|[echarts] update") (render-chart)
:unmount $ do (.!debug js/console "|[echarts] unmount") (dispose-chart)
Comment thread COMPONENTS.md
Comment on lines +214 to +217
`comp-chart-block` 将图表配置(kind、title、series)序列化为 Cirru EDN 格式,存储在 DOM 节点的 `title` 属性中。`main.mjs` 通过 `MutationObserver` 监听 `.echarts-host` 节点的插入,解析数据后调用 `echarts.setOption()` 渲染。

这与 Mermaid 图表的渲染方式相同,保持了一致的「Calcit 写入属性 → JS 读取渲染」的分工模式。

tiye added 3 commits July 10, 2026 00:20
- caps upgrade --all picks up respo-alerts.calcit 0.10.13 (with :js-ffi)
- Add missing :js-ffi to app.main/main!
- Now 0 warnings 🎉
- Rename 2026-05 -> 2026-05-26 based on git history (first commit date)
- Add RFC: edn-renderer 的表单状态、事件与数据转换
@csvwolf
csvwolf merged commit 9cc2794 into main Jul 27, 2026
1 check passed
@csvwolf
csvwolf deleted the renderers branch July 27, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants